CALENDAR=$(shell date '+%Y%m%d')

all:
	mkdir -p build
	cd build && cmake ..
	cd build && make -j12

run: all
	exec $(shell find build/ -maxdepth 1 -type f -executable)

debug: 
	mkdir -p build
	cd build && cmake -DCMAKE_BUILD_TYPE=Debug ..
	cd build && make -j12

release:
	mkdir -p build
	cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
	cd build && make -j12

package: release
	cd build && make package
	tree build/_CPack_Packages/Linux/DEB/qss-designer-panel-*
	dpkg-deb --contents build/qss-designer-panel_*$(CALENDAR)*.deb
	# cd build/_CPack_Packages/Linux/DEB/qss-designer-panel_*$(CALENDAR)*.deb && find .

copytosource:package
	cp build/qss-designer-panel_*$(CALENDAR)*.deb .